package cn.cloud9;

public class MainApplication {
    /**
     * jedis读取redis数据案例，通过自增实现次数控制
     * @param args
     */
    public static void main(String[] args) {
        Service service = new Service(20, "一般用户", 10L);
        Service service2 = new Service(40, "高级用户", 30L);
        Thread thread = new Thread( () -> {
            while (true) {
                try {
                    Thread.sleep(500);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                service.service();
            }
        });
        thread.start();

        thread = new Thread( () -> {
            while (true) {
                try {
                    Thread.sleep(500);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                service2.service();
            }
        });
        thread.start();
    }
}
